package com.example.cafe.work.service.impl;

import com.example.cafe.work.dto.Result;
import com.example.cafe.work.model.Ticket;
import com.example.cafe.work.mapper.TicketMapper;
import com.example.cafe.work.service.TicketService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author hua
 * @since 2024-09-16
 */
@Service
public class TicketServiceImpl extends ServiceImpl<TicketMapper, Ticket> implements TicketService {
    @Resource
    TicketMapper ticketMapper;

    @Override
    public Result add(Ticket ticket) {
        int insert = ticketMapper.add(ticket);
        return Result.ok(insert);
    }

    @Override
    public Result selectAll() {
        return Result.ok(ticketMapper.selectAll());
    }

}
